package test;

public class test1 {

	public static void main(String[] args) {
		Person person = new Person("LEE",25);
		Person student=new Student("李四",18,"202301");
		person.introduce();
		student.introduce();

	}
	public static class Person{
		private String name;
		private int  age;
		public Person(String name,int age) {
			this.name=name;
			this.age=age;
		}
		public String getName() {
			return name;
		}
		public int getAge() {
			return age;
		}
		public void introduce() {
			System.out.println("我叫"+name+"，今年"+age+"岁。");
		}
	}
	
	public static class Student extends Person {
	    private String studentId;

	    public Student(String name, int age, String studentId) {
	        super(name, age);
	        this.studentId = studentId;
	    }

	    public String getStudentId() {
	        return studentId;
	    }

	    @Override
	    public void introduce() {
	        System.out.println("我叫" + super.getName() + "，今年" + super.getAge() + "岁，我的学号是" + studentId + "。");
	    }
	}
	

}
